{extend name="common/adminBase" /}
{block name="body"}
<style>
    .x-admin-sm .layui-icon {
        font-size: 20px;
    }
</style>
<body >
<div style="width: 90%;margin-top: 20px">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">站点名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" value="{$data.title}" required  lay-verify="required" placeholder="请输入站点名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">备案号码</label>
            <div class="layui-input-block">
                <input type="text" name="number" value="{$data.number}" required  lay-verify="required" placeholder="请输入备案号码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">企业地址</label>
            <div class="layui-input-block">
                <input type="text" name="address" value="{$data.address}" required  lay-verify="required" placeholder="请输入企业地址" autocomplete="off" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">主题切换</label>
            <div class="layui-input-block">
                <input type="radio" name="theme" value="1" title="主题1" {if $data.theme == 1}checked{/if}>
                <input type="radio" name="theme" value="2" title="主题2" {if $data.theme == 2}checked{/if}>
                <input type="radio" name="theme" value="3" title="主题3" {if $data.theme == 3}checked{/if}>
                <input type="radio" name="theme" value="4" title="主题4" {if $data.theme == 4}checked{/if}>
                <input type="radio" name="theme" value="5" title="主题5" {if $data.theme == 5}checked{/if}>
                <input type="radio" name="theme" value="6" title="主题6" {if $data.theme == 6}checked{/if}>
                <input type="radio" name="theme" value="7" title="主题7" {if $data.theme == 7}checked{/if}>
            </div>
        </div>
        <br><br>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>


<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            $.ajax({
                url:'/index/WebConfig/editConfig',
                data:data.field,
                type:'post',
                dataType:'json',
                success:function (res) {
                    if (res.status==1){
                        layer.msg(res.msg,{icon:1,time:1500},function(){
                            top.location.href='/index/Index/index'
                        })
                    }else{
                        layer.alert(res.msg,function(index){
                            layer.close(index)
                        })
                    }
                }
            })
            return false;
        });
    });
</script>
</body>
{/block}